package com.three.dao;

import com.three.domain.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface ProjectsDao {
    public int PageCountProjects(@Param("keyword") String keyword, @Param("start_date") String start_date, @Param("end_date") String end_date);
    public List<Projects> projectsList(@Param("keyword") String keyword, @Param("start_date") String start_date, @Param("end_date") String end_date,
                                       @Param("pageIndex")Integer pageIndex,
                                       @Param("pageSize")Integer pageSize);
    public int addProjects(Projects projects);
    public int PageCountTasks(@Param("keyword") String keyword,
                              @Param("start_date") String start_date,
                              @Param("end_date") String end_date,
                              @Param("project_id")Integer project_id,
                              @Param("subproject_id")Integer subproject_id);
    public List<Tasks> tasksList(@Param("keyword") String keyword,
                                 @Param("start_date") String start_date,
                                 @Param("end_date") String end_date,
                                 @Param("pageIndex")Integer pageIndex,
                                 @Param("pageSize")Integer pageSize,
                                 @Param("project_id")Integer project_id,
                                 @Param("subproject_id")Integer subproject_id);
    public int addTasks(Tasks tasks);
    public Double tasksProportion(@Param("project_id") Integer project_id, @Param("subproject_id") Integer subproject_id);
    public int updateTasks(Tasks tasks);
    public double subprojectProgress(@Param("subproject_id") Integer subproject_id);
    public int updateProgress(@Param("subproject_progress") Double subproject_progress,@Param("subproject_id") Integer subproject_id);


    public Double project_progress(@Param("subproject_id") Integer subproject_id);
    public int updateProjectProgress(@Param("project_progress") Double project_progress,@Param("project_id") Integer project_id);


    public int deleteTasks(@Param("task_id") Integer task_id,@Param("subproject_id") Integer subproject_id,@Param("project_id") Integer project_id);
    public List<Projectmembers> projectsListBytProjectmembers(@Param("project_id") Integer project_id);

    public List<Users>  notInProjectmembers();
    public int addProjectmembers(@Param("pmList") List<Projectmembers> pmList);


    public Double SubprojectsProportion(@Param("project_id") Integer project_id);


    public int PageCountProectsByteacher(@Param("manager_id")Integer manager_id);
    public List<Projects> projectsListByteacher(@Param("manager_id") Integer manager_id, @Param("keyword") String keyword, @Param("start_date") String start_date, @Param("end_date") String end_date, @Param("pageIndex")Integer pageIndex, @Param("pageSize")Integer pageSize);

    public int PageCountSubprojects(
            @Param("project_id") Integer project_id);
    public List<Subprojects> subprojectsList(
            @Param("project_id") Integer project_id,
            @Param("pageIndex")Integer pageIndex,
            @Param("pageSize")Integer pageSize);
    public int addSubprojects(Subprojects subprojects);

    public int updateTasksByStudent(Tasks tasks);


}
